Landed Cost Allocation POST

URI

https://{DATACENTER}.brightpearlconnect.com/public-api/{ACCOUNT}
/accounting-service/landed-cost-allocation

Refer to our documentation on URI syntax for more information on how to construct URIs.

Description

POST /landed-cost-allocation. Returns the created journal IDs. All journals in one allocation are validated and persisted in one Accounting transaction. A rejected journal rolls back the entire allocation. The operation does not insert landed-cost estimates.

nominalCode is the required cost nominal; invoiceReference is optional. batches contains one entry per PO row and received batch, with positive orderRowId, purchaseOrderId and batchId; unitCostBaseCurrency; stock, sold and corrected quantities; stockNominal; cogsNominal; and soldByOrder, a map of sales order IDs to sold quantities. Quantities are inventory balances and costs may be negative. stock includes allocated but unshipped inventory.

orders maps order IDs to channelId, projectId and leadSourceId metadata. Include every purchase order and, when splitAcrossSalesOrders is true, each referenced sales order. These optional metadata values may be null. splitAcrossSalesOrders defaults to false and preserves the caller's feature configuration for assigning sold costs to sales orders.

Accounting posts in the account base currency at exchange rate 1, on the current account-local date, grouping separately by batch and stock/sold/corrected category. Empty inventory creates no journals. Amounts are calculated to four decimal places, then rounded to two; negative costs reverse the debit and credit sides using positive amounts.

Example

MISSING EXAMPLE PURPOSE

Request URI

/landed-cost-allocation

Request body

{
	"nominalCode": "2070",
	"invoiceReference": "LC-001",
	"splitAcrossSalesOrders": false,
	"batches": [
		{
			"orderRowId": 11,
			"purchaseOrderId": 42,
			"batchId": 1,
			"unitCostBaseCurrency": 0.1,
			"stockNominal": "1001",
			"cogsNominal": "5000",
			"stock": 50,
			"sold": 0,
			"corrected": 0,
			"soldByOrder": {
			}
		}
	],
	"orders": {
		"42": {
			"channelId": null,
			"projectId": null,
			"leadSourceId": null
		}
	}
}

Response

{
	"response": [
		81
	]
}